package com.andy.buyu.server.dto;

import java.util.List;

import com.andy.buyu.server.game.Rank;
import com.andy.buyu.server.game.Room;

import io.netty.buffer.ByteBuf;

/**
 * 房间奖励
 * @author cuiwm
 */
public class RoomRewardMessage extends BaseMessage{
	
    private Room room;
    
    public RoomRewardMessage(Room room) {
    	this.room = room;
	}

	@Override
	public void writeBody(ByteBuf buf) {
		List<Rank> ranks = room.getRanks();
		buf.writeInt(room.getId());
		buf.writeInt(ranks.size());
		for(Rank rank:ranks){
			buf.writeInt(rank.getFishId());
			buf.writeInt(rank.getRate());
		}
	}


}